package cn.bincker.mybatis.encrypt.type;

import lombok.Data;

@Data
public class EncryptParam<T> {
    private final Class<?> cls;
    private final String property;
    private final Object target;
    private final Object value;

    /**
     * EncryptParam构造函数
     * @param cls 加密实体类
     * @param property 加密实体类属性
     * @param value 加密值
     */
    public EncryptParam(Class<T> cls, String property, Object value) {
        this.cls = cls;
        this.property = property;
        this.target = null;
        this.value = value;
    }

    /**
     * EncryptParam构造函数
     * @param cls 加密实体类
     * @param property 加密实体类属性
     * @param target 加密目标类（用于取行级密钥，一般置空）
     * @param value 加密值
     */
    public EncryptParam(Class<T> cls, String property, Object target, Object value) {
        this.cls = cls;
        this.property = property;
        this.target = target;
        this.value = value;
    }
}
